﻿#region Copyright

//  ======================================================
//      Copyright (c) 2011 Toulr All rights reserved.
//     
//      The use and distribution terms for this software are contained in the file
//      named license.txt, which can be found in the root of this distribution.
//      By using this software in any fashion, you are agreeing to be bound by the
//      terms of this license.
//     
//     You must not remove this notice, or any other, from this software.
//  ======================================================

#endregion

#region Using Namespaces

using System;
using System.ComponentModel.DataAnnotations;

#endregion

namespace Toulr.Domains.Account
{
    public class Messages : IEntity
    {
        #region Property
        /// <summary>
        ///   记录标识
        /// </summary>
        [Key]
        public Int32 Id { get; set; }

        /// <summary>
        ///   发送时间
        /// </summary>
        [Required]
        public DateTime SentTime { get; set; }

        /// <summary>
        ///   消息发送用户ID
        /// </summary>
        public int SentUserId { get; set; }

        /// <summary>
        ///   消息接收用户
        /// </summary>
        public int RecieveUser { get; set; }

        /// <summary>
        ///   消息内容
        /// </summary>
        [Required]
        public String Message { get; set; }

        /// <summary>
        ///   是否已经阅读
        /// </summary>
        public bool Readed { get; set; }
        #endregion

        #region Association Objects

        /// <summary>
        ///   消息发送用户
        /// </summary>
        [NotMapped]
        public virtual User SentUser
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }
}